<!doctype html>
<html lang="en" ng-app="myApp">
<head>
  <meta charset="utf-8">
  <title>Modal | Onsen UI</title>
  <link rel="stylesheet" href="../styles/app.css"/>
  <link rel="stylesheet" href="../../build/css/onsenui.css">
  <link rel="stylesheet" href="../../build/css/onsen-css-components.css">

  <script src="../../build/js/angular/angular.js"></script>
  <script src="../../build/js/onsenui.js"></script>
  <script src="../app.js"></script>
  <script>
    angular.module('myApp').controller('PageController', function($scope) {
      $scope.open = function() {
        $scope.app.modal.show();
        setTimeout(function() {
          $scope.app.modal.hide();
        }, 2000);
      };
    });
  </script>
</head>

<body ng-controller="PageController">

  <ons-navigator>

    <ons-modal var="app.modal">
      <ons-icon icon="gear" spin="true" style="line-height: 20px; vertical-align: middle;"></ons-icon>
      <span style="line-height: 20px; font-size: 15px;">Loading...</span>
    </ons-modal>

    <ons-toolbar>
      <div class="center">Modal</div>
    </ons-toolbar>

    <p style="text-align: center">
      <ons-button modifier="light" ng-click="open();">Open Modal</ons-button>
    </p>

  </ons-navigator>

</body>
</html>
